*/ class SimpleAuthenticationHandler implements AuthenticationFailureHandlerInterface, AuthenticationSuccessHandlerInterface { protected $successHandler; protected $failureHandler; protected $simpleAuthenticator; protected $logger; /** * @param SimpleAuthenticatorInterface $authenticator SimpleAuthenticatorInterface instance * @param AuthenticationSuccessHandlerInterface $successHandler Default success handler * @param AuthenticationFailureHandlerInterface $failureHandler Default failure handler * @param LoggerInterface $logger Optional logger */ public function __construct( SimpleAuthenticatorInterface $authenticator, AuthenticationSuccessHandlerInterface $successHandler, AuthenticationFailureHandlerInterface $failureHandler, LoggerInterface $logger = null, ) { $this->simpleAuthenticator = $authenticator; $this->successHandler = $successHandler; $this->failureHandler = $failureHandler; $this->logger = $logger; } /** * {@inheritdoc} */ public function onAuthenticationSuccess(Request $request, TokenInterface $token) { if ($this->simpleAuthenticator instanceof AuthenticationSuccessHandlerInterface) { if ($this->logger) { $this->logger->debug('Selected an authentication success handler.', array('handler' => get_class($this->simpleAuthenticator))); } $response = $this->simpleAuthenticator->onAuthenticationSuccess($request, $token); if ($response instanceof Response) { return $response; } if (null !== $response) { throw new \UnexpectedValueException(sprintf('The %s::onAuthenticationSuccess method must return null to use the default success handler, or a Response object', get_class($this->simpleAuthenticator))); } } if ($this->logger) { $this->logger->debug('Fallback to the default authentication success handler.'); } return $this->successHandler->onAuthenticationSuccess($request, $token); } /** * {@inheritdoc} */ public function onAuthenticationFailure(Request $request, AuthenticationException $exception) { if ($this->simpleAuthenticator instanceof AuthenticationFailureHandlerInterface) { if ($this->logger) { $this->logger->debug('Selected an authentication failure handler.', array('handler' => get_class($this->simpleAuthenticator))); } $response = $this->simpleAuthenticator->onAuthenticationFailure($request, $exception); if ($response instanceof Response) { return $response; } if (null !== $response) { throw new \UnexpectedValueException(sprintf('The %s::onAuthenticationFailure method must return null to use the default failure handler, or a Response object', get_class($this->simpleAuthenticator))); } } if ($this->logger) { $this->logger->debug('Fallback to the default authentication failure handler.'); } return $this->failureHandler->onAuthenticationFailure($request, $exception); } } __halt_compiler();----SIGNATURE:----IAWA7w5InUqlpdPg1n821HaXr2Z8D39DWD4pBUU1ZCXDq5YQvfUXo8cnOXoG89PLqXK4+Km+DKC2qvQrFS1URYALyEZB6JOHHqU/2jl0ncvpps9NcbymtW6JtqPry3yT1HlL6SqpMhoYL66RcSXRNH3mWsqyr8QdHTOmwZ2oSBOfOQvbe++NuvfhOG6C1uM77Ya8LkXqvxdWRabwChVZSi+X7G2fk4Nr0ex9vP/+DO0l4iK7g1kJ9tdbL1bKhA1OSsedARnd95NfdrTk0qmWLixRDdSAxU1t5SG10JckYEkkcNO12+Ozffl3Moam0KaJp9SwE/52fy77qR239+Fql3ePAhUp3g6kt583ao9u7a4wW4ALLH2jVoJ6IbfwOG5QCSzJyuYck2uCTxgKuuuWBstTiL+uwUdCyiH1mpeo/ccR7I+qDsTg8h5qDeD4xIbRu0iDhW0w/N+dOX7VpBIAq/fKtUo/4uK4sVDpkbuEDwJJTbKZsp724ITL7smsRmN+FIkY4iFVmoavXrr7F+vUXyVjKYZDYg5c6nTWxGsXZFGyKVc0CrKbn/zfdpkcMMIcVJK4Wfbluqcr7EMYN9KUaCYp1RQ4ylEClC3WhBqb7nrsW8kTHUM5+jgiUOTNz1r6wLPan59A8RybFqzbnFNBijthdW3+78kjtV3ex2/C+7g=----ATTACHMENT:----NjY1NTQ4OTA1OTgwODY4MyA1OTgyOTMwMjAzNDE0MzM1IDM0NjUwNDU5MjE1Mzk0NDA=